package com.peas.platform.module.icims.base.approve.adapter.repository.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.peas.platform.common.core.annotation.Comment;
import com.peas.platform.framework.mybatisplus.po.BasePo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import javax.validation.constraints.*;

// 审批单操作
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`tbl_approve_order_oper`")
public class ApproveOrderOperPo extends BasePo {

    // 审批单操作类型
    // 枚举取值:ApproveOrderOperType
    @Comment(value = "审批单操作类型", enumType = "ApproveOrderOperType")
    @NotBlank(message = "审批单操作类型不能为空")
    @Size(max = 20, message = "审批单操作类型不能超过20个字符")
    @TableField(value = "`approve_order_oper_type`", jdbcType = JdbcType.VARCHAR)
    private String approveOrderOperType;

    // 审批单ID
    // （审批单表）外键
    @Comment(value = "审批单ID")
    @NotNull(message = "审批单ID不能为空")
    @TableField(value = "`approve_order_id`", jdbcType = JdbcType.BIGINT)
    private Long approveOrderId;

    // 审批单编号
    @Comment(value = "审批单编号")
    @NotBlank(message = "审批单编号不能为空")
    @Size(max = 100, message = "审批单编号不能超过100个字符")
    @TableField(value = "`approve_order_code`", jdbcType = JdbcType.VARCHAR)
    private String approveOrderCode;

    // 审批单名称
    @Comment(value = "审批单名称")
    @Size(max = 200, message = "审批单名称不能超过200个字符")
    @TableField(value = "`approve_order_name`", jdbcType = JdbcType.VARCHAR)
    private String approveOrderName;

    // 当前审批人用户ID
    // （用户表）外键
    @Comment(value = "当前审批人用户ID")
    @NotNull(message = "当前审批人用户ID不能为空")
    @TableField(value = "`current_approve_user_id`", jdbcType = JdbcType.BIGINT)
    private Long currentApproveUserId;

    // 当前节点编号
    @Comment(value = "当前节点编号")
    @Max(value = 9, message = "当前节点编号取值无效")
    @TableField(value = "`current_no`", jdbcType = JdbcType.INTEGER)
    private Integer currentNo;

    // 当前节点名称
    @Comment(value = "当前节点名称")
    @Size(max = 100, message = "当前节点名称不能超过100个字符")
    @TableField(value = "`current_name`", jdbcType = JdbcType.VARCHAR)
    private String currentName;

    // 审批结果
    // 通过、驳回
    // 枚举取值:ApproveResult
    @Comment(value = "审批结果", enumType = "ApproveResult")
    @Size(max = 20, message = "审批结果不能超过20个字符")
    @TableField(value = "`approve_result`", jdbcType = JdbcType.VARCHAR)
    private String approveResult;

    // 审批意见
    @Comment(value = "审批意见")
    @TableField(value = "`approve_opinion`", jdbcType = JdbcType.CLOB)
    private String approveOpinion;

    // 业务单类型
    // 枚举取值:ApproveOrderBusinessType
    @Comment(value = "业务单类型", enumType = "ApproveOrderBusinessType")
    @Size(max = 20, message = "业务单类型不能超过20个字符")
    @TableField(value = "`business_type`", jdbcType = JdbcType.VARCHAR)
    private String businessType;

    // 业务单ID
    // 外键
    @Comment(value = "业务单ID")
    @TableField(value = "`business_id`", jdbcType = JdbcType.BIGINT)
    private Long businessId;

    // 业务单详情URL
    @Comment(value = "业务单详情URL")
    @Size(max = 500, message = "业务单详情URL不能超过500个字符")
    @TableField(value = "`business_url`", jdbcType = JdbcType.VARCHAR)
    private String businessUrl;

}
